<?php 
class ConfigController extends Controller{
	private $db;
	public function __init(){
		$this->db=K('Config');
	}
	
	//设置配置项
	public function set(){
		if(IS_POST){
			if($this->db->updateConfig()){
				$this->success('修改成功');
			}else{
				$this->error($this->db->error);
			} 
		}else{
			//获取配置项
			$config=$this->db->get();
			$this->assign('config',$config);
			$this->display();
		}
	}
}//配置项控制器类结束